Skip to content

Allow trailing semi-colon after typedef - #7

Open
lizard-boy wants to merge 1 commit into
masterfrom
allow-trailing-semicolon
Open

Allow trailing semi-colon after typedef#7
lizard-boy wants to merge 1 commit into
masterfrom
allow-trailing-semicolon

Conversation

@lizard-boy

Copy link
Copy Markdown

This is not exactly in the spec, but most Thrift parsers allow trailing semi-colon after typedef.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added support for trailing semicolons after typedef and const definitions, improving compatibility with other Thrift parsers.

  • Modified parseTypedef in src/main/parser.ts to consume optional trailing semicolons
  • Added new test fixtures and solutions in src/tests/parser and src/tests/scanner to verify the new behavior
  • Updated src/tests/parser/parser.spec.ts and src/tests/scanner/scanner.spec.ts with new test cases for trailing semicolons
  • Implemented changes consistently across parser and scanner components

7 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings

Comment on lines +1 to +2
const string test = 'asdf';
typedef i32 MyInteger;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate const declaration on line 3

@@ -0,0 +1,4 @@
const string test = 'asdf';
typedef i32 MyInteger;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate typedef declaration on line 4

Comment on lines +3 to +4
const string test = 'asdf'
typedef i32 MyInteger

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Inconsistent use of semicolons

}
}
},
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing semicolon after const definition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant